FROM nginx:1.23.3
MAINTAINER LIUJG

# 创建目录
RUN mkdir -p /code/dist
RUN mkdir -p /code/log
RUN touch /code/log/web-err.log
RUN touch /code/log/web-access.log

# 复制代码文件到容器
ADD ./dist /code/dist

# 替换生产配置


# 替换nginx配置文件
RUN rm -rf /etc/nginx/conf.d/default.conf
COPY web.conf /etc/nginx/conf.d/default.conf.template

# 端口暴露
EXPOSE 80

WORKDIR /etc/nginx/conf.d

ENTRYPOINT envsubst '$uwsgi_pass' < default.conf.template > default.conf && nginx -g 'daemon off;'
